//
// Decompiled by Jadx - 372ms
//
package fg;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import fi.c;
import fi.h;
import java.util.ArrayList;
import java.util.List;
import r.g;

public final class b extends RecyclerView.h<c> {
    public final ArrayList a = new ArrayList();
    public final ArrayList b;
    public final a c;
    public final a d;

    public b(List list, h hVar, h hVar2) {
        ArrayList arrayList = new ArrayList();
        this.b = arrayList;
        this.c = hVar;
        this.d = hVar2;
        arrayList.addAll(list);
    }

    public final int getItemCount() {
        return this.b.size();
    }

    public final void onBindViewHolder(RecyclerView.ae aeVar, int i) {
        c cVar = (c) aeVar;
        c cVar2 = (c) this.b.get(i);
        cVar.getClass();
        boolean isEmpty = TextUtils.isEmpty(cVar2.getTitle());
        TextView textView = cVar.a;
        if (isEmpty) {
            textView.setVisibility(View.GONE);
        }
        textView.setText(g.w(textView, cVar2.getTitle()));
        textView.setGravity(cVar2.getGravity());
        if (cVar.d == null) {
            l lVar = new l(cVar2.getList(), new c(cVar, cVar2, i, 0), new d(i, cVar));
            cVar.d = lVar;
            cVar.e.setAdapter(lVar);
        }
        this.a.add(i, cVar.d);
    }

    public final RecyclerView.ae onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new c(LayoutInflater.from(viewGroup.getContext()).inflate(-2113142719, viewGroup, false), this.c, this.d);
    }


}
